: <> generated: 2023-Feb-20 11:22:17
: <> family: CaV
: <> type: HodgkinHuxleyAlphaBeta
: <> model: Eyring
: <> institution: EPFL
: <> lab: BBP
: <> host_cell: CHO_FT
: <> ion_channel: Cav3.2_cop
: <> species: Mouse
: <> temp: 25

NEURON {
    SUFFIX Cav3_2
    USEION ca READ eca WRITE ica
    RANGE gca, ica, gcabar
}

: ========== VARIABLES ==========

UNITS {
    (S) = (siemens)
    (mV) = (millivolt)
    (mA) = (milliamp)
}

PARAMETER {
    gcabar = 1.242692e+00 (S / cm2)
    P01 = 1.462502e+00 (1 / ms)
    P02 = 7.551070e-02 (1 / mV)
    P03 = 1.337136e+01 (mV)
    P04 = 1.847589e-03 (1 / ms)
    P05 = 8.068435e-02 (1 / mV)
    P06 = 5.424075e-02 (1 / ms)
    P07 = 1.213788e-01 (1 / mV)
    P08 = 4.470533e+01 (mV)
    P09 = 4.710278e-04 (1 / ms)
    P10 = 4.203063e-02 (1 / mV)
}

ASSIGNED {
    v (mV)
    eca (mV)
    ica (mA / cm2)
    gca (S / cm2)
    m_inf
    h_inf
    m_tau (ms)
    h_tau (ms)
}

: ========== FUNCTION DEFINITIONS ==========

FUNCTION mAlpha (vm (mV)) (1 / ms) {
    mAlpha = P01 / (1 + exp(-P02 * (vm + P03)))
}

FUNCTION mBeta (vm (mV)) (1 / ms) {
    mBeta = P04 * exp(-P05 * vm)
}

FUNCTION hAlpha (vm (mV)) (1 / ms) {
    hAlpha = P06 / (1 + exp(-P07 * (vm + P08)))
}

FUNCTION hBeta (vm (mV)) (1 / ms) {
    hBeta = P09 * exp(-P10 * vm)
}

FUNCTION mTau (vm (mV)) (ms) {
    mTau = 1 / (mAlpha(vm) + mBeta(vm))
}

FUNCTION hTau (vm (mV)) (ms) {
    hTau = 1 / (hAlpha(vm) + hBeta(vm))
}

FUNCTION mInf (vm (mV)) {
    mInf = mAlpha(vm) * mTau(vm)
}

FUNCTION hInf (vm (mV)) {
    hInf = hBeta(vm) * hTau(vm)
}

PROCEDURE rates() {
    m_tau = mTau(v)
    h_tau = hTau(v)
    m_inf = mInf(v)
    h_inf = hInf(v)
}

: ========== PROGRAM ==========

STATE {
    m
    h
}

INITIAL {
    rates()
    m = m_inf
    h = h_inf
}

BREAKPOINT {
    SOLVE states METHOD cnexp
    gca = gcabar * m * m * h
    ica = gca * (v - eca)
}

DERIVATIVE states {
    rates()
    m' = (m_inf  - m) / m_tau
    h' = (h_inf  - h) / h_tau
}
